package com.macro.mall.tiny.modules.pms.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.macro.mall.tiny.common.api.CommonResult;
import com.macro.mall.tiny.modules.pms.model.PmsCalculatorParam;
import com.macro.mall.tiny.modules.pms.service.PmsCalculatorParamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 计算器参数 前端控制器
 * </p>
 *
 * @author tyrone
 * @since 2024-11-01
 */
@RestController
@RequestMapping("/pms/pmsCalculatorParam")
@Api(tags = "PmsCalculatorParamController")
@Tag(name = "PmsCalculatorParamController", description = "计算器参数管理")
public class PmsCalculatorParamController {
    @Autowired
    private PmsCalculatorParamService pmsCalculatorParamService;


    @ApiOperation("根据id获取制定计算器的参数")
    @GetMapping("/getParam")
    public CommonResult<List<PmsCalculatorParam>> getParam(@RequestParam Integer id) {
        return CommonResult.success(pmsCalculatorParamService.list(new QueryWrapper<PmsCalculatorParam>().eq("calculator_id", id)));
    }

}

